package data_structure;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

public class Collector {
private static HashMap<String, Object> collector = new HashMap<String, Object>();

	public static void add(String key,Object o)
	{
		collector.put(key,o);
	}
	
	public static Object get(String key)
	{
		return collector.get(key);
	}
	
	public static void remove(String key)
	{
		collector.remove(key);
	}
	
	public static void clear()
	{
		collector.clear();
	}
	
	public static HashMap<String, Object> getCollection()
	{
		return collector;
	}
	
	public static Iterator<String> iterator()
	{
		return collector.keySet().iterator();
	}
	
	public static HashSet<String> getKeys()
	{
		HashSet<String> list = new HashSet<String>();
		Iterator<String> it = iterator();
		while (it.hasNext())
		{
			list.add(it.next());
		}
		return list;
	}
}
